# __coding:utf-8__
from email.mime.text import MIMEText;
import smtplib;
from urllib.request import urlopen;
from bs4 import BeautifulSoup;


def sendMail(subject, body):
    msg = MIMEText(body);
    msg['Subject'] = subject;
    msg['From'] = '';
    msg['To'] = '';

    smtpHandle = smtplib.SMTP('');
    smtpHandle.set_debuglevel(1);
    smtpHandle.login('', '')
    smtpHandle.send_message(msg);
    smtpHandle.close();



html = urlopen('http://guba.eastmoney.com/list,300059.html');
bsObj = BeautifulSoup(html, 'lxml');
result = bsObj.find('div', {'id': 'articlelistnew'});
sendMail('采集内容',result);